package com.my.app.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by 80002023 on 2016/5/11.
 */
@RestController
public class HomeController {

    private final Logger logger = LogManager.getLogger(getClass());

    @RequestMapping(value = "index", method = RequestMethod.GET)
    public ModelAndView index(Model model) {
        logger.info("index");
        model.addAttribute("curl", "");
        return new ModelAndView("index");
    }

    @RequestMapping(value = "views/dashboard", method = RequestMethod.GET)
    public ModelAndView dashboard(Model model) {
        logger.info("dashboard");
        model.addAttribute("curl", "");
        return new ModelAndView("pages/dashboard");
    }

}
